package com.lyxs916.testlibrary.downding;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.Button;

import com.lyxs916.appbaselibrary.core.activity.BaseActivity;
import com.lyxs916.testlibrary.R;
import com.lyxs916.utilslibrary.view.SupperToolBar;

/**
 * 说明:上传文件的测试
 * 作者： 杨阳; 创建于：  2017-06-15  10:50
 */
public class DownloadingActivity extends BaseActivity {
    Button selectPicture;
    SupperToolBar toolbar;
//    String downloadingUrl = "http://wap.dl.pinyin.sogou.com/wapdl/hole/201512/03/SogouInput_android_v7.11_sweb.apk";
    String downloadingUrl = "http://hajk.file.alimmdn.com/bz/honganUser.apk?1497838028820";

    public static void startUi(Context context) {
        Intent intent = new Intent(context, DownloadingActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        context.startActivity(intent);
    }

    @Override
    public int setContentView() {
        return R.layout.test_activity_downding;
    }

    @Override
    public void parseIntent(Intent intent) {
    }

    @Override
    public void initView() {
        toolbar = (SupperToolBar) findViewById(R.id.toolbar);
        selectPicture = (Button) findViewById(R.id.uploading);
        toolbar.setTitle("下载文件");
        toolbar.setBack(this);


        selectPicture.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                DownLoadManager.downloading(DownloadingActivity.this,"http://hajk.file.alimmdn.com/bz/honganUser.apk?1497838028820");
//                DownLoadManager.downloading(DownloadingActivity.this, "http://wap.dl.pinyin.sogou.com/wapdl/hole/201512/03/SogouInput_android_v7.11_sweb.apk");
                new VersionUpdataB().installAPK(mActivity, downloadingUrl);

            }
        });
    }


}
